package com.xj.oop1;

/**
 * 实体类
 */
public class Car {
    private int id;   //主键
    private String pinPai;
    private String yanSe;


    //如果显式的声明了有参的构造方法，那么无参的构造方法将被覆盖
    public Car(String pinPai, String yanSe) {
        this.pinPai = pinPai;
        this.yanSe = yanSe;
    }

    public Car(int id, String pinPai, String yanSe) {
        this.id = id;
        this.pinPai = pinPai;
        this.yanSe = yanSe;
    }

    //如果需要无参的构造方法，那么需要显式声明
    public Car() {
    }

    public void printInfo() {
        System.out.println("我是" + pinPai + "的车，是" + yanSe );
    }
    public void printInfo(int id){

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPinPai() {
        return pinPai;
    }

    public void setPinPai(String pinPai) {
        this.pinPai = pinPai;
    }

    public String getYanSe() {
        return yanSe;
    }

    public void setYanSe(String yanSe) {
        this.yanSe = yanSe;
    }
}
